package net.wds.study.clazz.service.impl;


import net.wds.study.clazz.dao.ClazzDao;
import net.wds.study.clazz.entity.Clazz;
import net.wds.study.clazz.service.ClazzService;
import net.wds.study.clazz.utils.PageModel;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by gf on 2020/9/8.
 */

@Service("calzzService")
public class ClazzServiceImpl implements ClazzService {
    @Resource
    private ClazzDao clazzDao;

    @Override
    public PageModel<Clazz> getPageByParams(Integer startIndex, Integer pageSize, String clazzMajor, String clazzYear, String clazzLeader) {

       //对startIndex值处理
        if (startIndex == null || startIndex < 0) {
            startIndex = 0;
        }

        return clazzDao.getPageByParams(startIndex,pageSize,clazzMajor,clazzYear,clazzLeader);
    }
}
